public class Runway {

	private boolean isBusy;
	private boolean isClosed;
	
	private Plane plane;
	private int closedFor;
	
	public Runway(Plane noPlane) {
		this.plane = noPlane;
	}

	public void update(){
		if(closedFor > 0){
			closedFor--;
			if(closedFor == 0){
				setIsClosed(false);
			}
		}
	}
	
	public int getClosedFor() {
		return closedFor;
	}

	public void setClosedFor(int closedFor) {
		this.closedFor = closedFor;
	}

	public Plane getPlane() {
		return plane;
	}

	public void setPlane(Plane plane) {
		if(plane != null){
			this.plane = plane;
		}
	}

	public boolean isBusy(){
		return isBusy ? true : false;
	}
	
	public boolean isClosed(){
		return isClosed ? true : false;
	}
	
	public void setIsBusy(boolean isBusy){
		this.isBusy=isBusy;
	}
	
	public void setIsClosed(boolean isClosed){
		this.isClosed=isClosed;
	}
	
	
}
